<?php

namespace app\xwam\validate;

/**
 * 类别验证类
 *
 * @version 2018-1-27 sochishun added.
 */
class CategoryValidate extends \think\Validate {

    // 批量验证
    protected $batch = false;
    // 当前验证的规则
    protected $rule = [
        'pid' => 'number',
        'title' => 'require|max:25',
    ];
    // 验证字段描述
    protected $field = [
        'id' => 'ID',
        'pid' => '父级ID',
        'title' => '名称',
    ];
    // 验证场景
    protected $scene = [
        'add' => ['pid', 'title'],
        'edit' => ['id', 'pid', 'title'],
    ];

}
